//
//  BannerVC.swift
//  DayStudy
//
//  Created by Wheatping on 16/3/4.
//  Copyright © 2016年 Wheatping. All rights reserved.
//

import UIKit

class BannerVC: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.view.backgroundColor=UIColor.whiteColor()

        let url1 = "http://img5q.duitang.com/uploads/item/201501/27/20150127163843_BQyf3.jpeg"
        let url2 = "http://img5.duitang.com/uploads/item/201501/27/20150127164025_BzEm8.jpeg"
        let url3 = "http://bizhi.33lc.com/uploadfile/2015/0130/20150130023019720.jpg"
        let url4 = "http://bizhi.33lc.com/uploadfile/2015/0130/20150130023017376.jpg"
        let urls = [url1,url2,url3,url4]
        
        let bannerV=BannerView(frame: CGRectMake(0, 100.0, self.view.frame.size.width, self.view.frame.size.height-200.0))
        bannerV.dataSourceImages=urls
        bannerV.startRun()
        
        bannerV.toIndex={(index)->() in
            
            print("当前图片序号:\(index)")
        }
        bannerV.selectIndex={(index)->() in
            
            print("点击的图片序号:\(index)")
        }

        
        
        self.view.addSubview(bannerV)

    }
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
